package com.lw.mall.entity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.Data;

import javax.persistence.*;
import java.io.Serializable;
import java.math.BigDecimal;
import java.util.Date;

@Data
@Entity
@JsonIgnoreProperties({ "handler","hibernateLazyInitializer" })
public class Product implements Serializable {
    @Id
    @GeneratedValue
    @Column
    @TableId(value = "id", type = IdType.AUTO)
    private Integer id;
    /**
     * 商品标题
     */
    @Column
    private String title;
    /**
     * 市场价
     */
    @Column
    private BigDecimal marketPrice;
    /**
     * 商城价
     */
    @Column
    private BigDecimal shopPrice;
    /**
     * 主图
     */
    @Column
    private String image;
    /**
     * 描述
     */
    @Column(name = "`desc`", columnDefinition = "text")
    @TableField("`desc`")
    private String desc;
    /**
     * 是否热门商品
     */
    @Column
    private Integer isHot;
    /**
     * 二级分类Id
     */
    @Column
    private Integer csid;
    /**
     * 商品创建日期
     */
    @Column
    private Date pdate;

    @TableField(exist = false)
    @Transient
    private Classification categorySec;

    /**
     * 卖家id
     */
    @Column
    private Integer sellId;

    /**
     *  是否下架
     */
    @Column
    private Integer isDown;

}